#ifndef INFINITY_ENTITY_H
#	define INFINITY_ENTITY_H

#include "managedgameobject.h"

namespace infinity {

class ServiceEntity;

struct EntityId
{
public : //! @name Constants
	//! @{
	static const EntityId Invalid;
	//! @}

public : //! @name Construction & Destruction
	//! @{
	EntityId(const EntityId& ref = Invalid);
	explicit EntityId(const dw::uint64& pId);
	//! @}

public : //! @name Helpers
	//! @{
	EntityId& operator = (const EntityId& rhs);
	//! @}

public : //! @name Data
	//! @{
	dw::uint64 id;
	//! @}
};

bool operator == (const EntityId& lhs, const EntityId& rhs);

class Entity
:	public ManagedGameObject< ServiceEntity >
{
public : //! @name Types definitions
	//! @{
	typedef ManagedGameObject< ServiceEntity > super;

	enum LifeState
	{
		LifeState_Invalid,
		LifeState_Borning,
		LifeState_Living,
		LifeState_Condemned
	};

	enum type
	{
		Type_Invalid = -1,
		Type_Collectible = 0,
		Type_Grenade ,

		Type_Item , /// a developper pour chaque item ....
		Type_Item_craftbox , 
		Type_Item_chest
	};
	//! @}

public : //! @name Commands
	//! @{
	virtual void renderDebug();

public :
	virtual type getType() const { return Type_Invalid;  }
	//! @}

public : //! @name State
	//! @{
	const EntityId& getId() const ;
	const std::string& getName() const ;
	LifeState getLifeState() const ;
	//! @}

protected : //! @name Construction & Destruction
	//! @{
	Entity();
	virtual ~Entity();
	//! @}

protected : //! @name Internal setup
	//! @{
	friend class ServiceEntity;

	void setId(const EntityId& id);
	void setName(const std::string& name);
	void setLifeState(LifeState state);
	//! @}

private : //! @name Data
	//! @{
	EntityId m_id;
	std::string m_name;
	LifeState m_lifeState;
	//! @}
};

} // namespace infinity

#include "entity.inl"

#endif // INFINITY_ENTITY_H
